import React, { LazyExoticComponent, Suspense } from "react";
import { Spin } from "antd";
const LazyLoad=(Comp:LazyExoticComponent<any>):React.ReactNode=>{
    return (
        <Suspense fallback={<Spin size="large" style={{
            display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"
            }} />}>
            <Comp/>
        </Suspense>
    )
}

export default LazyLoad